<template>
  <view class="hot">
    <view class="hot-content flex-between">
      <view class="title"
        ><image src="/static/icon/hot.png" mode="widthFix"></image> 热门文章
      </view>
      <view class="more"> 滑动查看 </view>
    </view>
    <view class="hot-content-scroll br10">
      <view
        class="scroll-item"
        v-for="(v, i) in articleHotlList"
        :key="v.id"
        @click="HandleView(v.id)"
      >
        <view
          class="cover br10"
          :style="{ backgroundImage: 'url(' + v.cover + ')' }"
        />

        <view class="hot-title">
          <view class="title t1">
            {{ v.title }}
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: ["articleHotlList"],
  methods: {
    HandleView(id) {
      let avatar = uni.getStorageSync("avatar")
      if (!avatar) {
        uni.navigateTo({
          url: "/pages/login/login",
        })
        return
      }
      uni.navigateTo({
        url: "/pages/detail/detail?id=" + id,
      })
    },
  },
}
</script>

<style lang="scss" scoped></style>
